package zr.com.thread.pool;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.TimeUnit;

public class MainTest {

    public static void main(String[] args) throws InterruptedException {

        Producer producer1 = new Producer();
        Producer producer2 = new Producer();
        Producer producer3 = new Producer();
        Producer producer4 = new Producer();
        Producer producer5 = new Producer();
        Producer producer6 = new Producer();
        new Thread(producer1,"producer1").start();
        new Thread(producer2,"producer2").start();
        new Thread(producer3,"producer3").start();
        new Thread(producer4,"producer4").start();
        new Thread(producer5,"producer5").start();
        new Thread(producer6,"producer6").start();

        Consumer consumer1 = new Consumer(producer1.QUEUE);
        new Thread(consumer1,"consumer1").start();

        Consumer consumer2 = new Consumer(producer2.QUEUE);
        new Thread(consumer2,"consumer2").start();

        Consumer consumer3 = new Consumer(producer3.QUEUE);
        new Thread(consumer3,"consumer3").start();

        Consumer consumer4 = new Consumer(producer4.QUEUE);
        new Thread(consumer4,"consumer4").start();

        Consumer consumer5 = new Consumer(producer5.QUEUE);
        new Thread(consumer5,"consumer4").start();

        Consumer consumer6 = new Consumer(producer6.QUEUE);
        new Thread(consumer6,"consumer5").start();

    }
}
